# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NearestNeighborQueryNumericFilter do
  @moduledoc """
  Numeric filter is used to search a subset of the entities by using boolean rules on numeric columns. For example: Database Point 0: {name: "a" value_int: 42} {name: "b" value_float: 1.0} Database Point 1: {name: "a" value_int: 10} {name: "b" value_float: 2.0} Database Point 2: {name: "a" value_int: -1} {name: "b" value_float: 3.0} Query: {name: "a" value_int: 12 operator: LESS} // Matches Point 1, 2 {name: "b" value_float: 2.0 operator: EQUAL} // Matches Point 1

  ## Attributes

  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Column name in BigQuery that used as filters.
  *   `op` (*type:* `String.t`, *default:* `nil`) - Optional. This MUST be specified for queries and must NOT be specified for database points.
  *   `valueDouble` (*type:* `float()`, *default:* `nil`) - double value type.
  *   `valueFloat` (*type:* `number()`, *default:* `nil`) - float value type.
  *   `valueInt` (*type:* `String.t`, *default:* `nil`) - int value type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :name => String.t() | nil,
          :op => String.t() | nil,
          :valueDouble => float() | nil,
          :valueFloat => number() | nil,
          :valueInt => String.t() | nil
        }

  field(:name)
  field(:op)
  field(:valueDouble)
  field(:valueFloat)
  field(:valueInt)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NearestNeighborQueryNumericFilter do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NearestNeighborQueryNumericFilter.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1NearestNeighborQueryNumericFilter do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
